package com.j283_5.wisdom_park.controller.investment_management.customer_development;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Visitors;
import com.j283_5.wisdom_park.service.CustomerDevelopmentService;
import com.j283_5.wisdom_park.vo.contract_management.CustomerNeedsVo;
import com.j283_5.wisdom_park.vo.contract_management.CustomerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 客户管理 前端控制器
 * </p>
 *
 * @author 冯弋舟
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/customer-development")
@Api(value = "客户管理",tags = "客户管理",produces="冯弋舟")
public class CustomerDevelopmentController {

    @Resource
    private CustomerDevelopmentService service;

    /**
     * 多条件查询合同
     * @return
     */
    @RequestMapping(value = "/findCustomer" , method = RequestMethod.GET)
    @ApiOperation(value = "查询所有客户信息",notes = "查询所有客户信息（分页）",produces="冯弋舟", response = ResultData.class)
    public ResultData findCustomer(@Param("page") Integer page, @Param("limit")Integer limit, @Param("customerVo") CustomerVo customerVo){
        List<CustomerVo> list=new ArrayList<>();
        CustomerVo customerVo1=new CustomerVo(1,"罗遗言文化有限公司",0,1,0,"杰克",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),"13121321","1561651","跟进内容");
        list.add(customerVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 查询客户需求信息
     * @return
     */
    @RequestMapping(value = "/findCustomerNeeds" , method = RequestMethod.GET)
    @ApiOperation(value = "查询客户需求信息",notes = "查询客户需求信息",produces="冯弋舟", response = ResultData.class)
    public ResultData findCustomerNeeds(CustomerNeedsVo customerNeedsVo){
        List<CustomerNeedsVo> list=new ArrayList<>();
        CustomerNeedsVo customerNeedsVo1=new CustomerNeedsVo(50.0,145.0,1.5,1.9,"租房办公",1,"A1栋",802);
        list.add(customerNeedsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 插入客户信息
     * @return
     */
    @RequestMapping(value = "/insertCustomer" , method = RequestMethod.POST)
    @ApiOperation(value = "插入客户信息",notes = "插入客户信息",produces="冯弋舟", response = ResultData.class)
    public ResultData InsertCustomer(@Param("customerNeedsVo") CustomerNeedsVo customerNeedsVo,@Param("customerVo") CustomerVo customerVo){
//        Map<String,Object> map=new HashMap<>();
//        List<CustomerVo> list1=new ArrayList<>();
//        CustomerVo customerVo1=new CustomerVo(1,"罗遗言文化有限公司",0,1,0,"杰克",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),"13121321","1561651");
//        List<CustomerNeedsVo> list2=new ArrayList<>();
//        CustomerNeedsVo customerNeedsVo1=new CustomerNeedsVo(50.0,145.0,1.5,1.9,"租房办公",1,"A1栋",802);
//        map.put("customerNeedsVo",customerNeedsVo1);
//        map.put("customerVo",customerVo1);
        return ResultData.ok();
    }
    /**
     * 编辑客户信息
     * @return
     */
    @RequestMapping(value = "/updateCustomer" , method = RequestMethod.POST)
    @ApiOperation(value = "编辑客户信息",notes = "编辑客户信息",produces="冯弋舟", response = ResultData.class)
    public ResultData UpdateCustomer(@Param("customerNeedsVo") CustomerNeedsVo customerNeedsVo,@Param("customerVo") CustomerVo customerVo){
//        Map<String,Object> map=new HashMap<>();
//        List<CustomerVo> list1=new ArrayList<>();
//        CustomerVo customerVo1=new CustomerVo(1,"罗遗言文化有限公司",0,1,0,"杰克",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),"13121321","1561651");
//        List<CustomerNeedsVo> list2=new ArrayList<>();
//        CustomerNeedsVo customerNeedsVo1=new CustomerNeedsVo(50.0,145.0,1.5,1.9,"租房办公",1,"A1栋",802);
//        map.put("customerNeedsVo",customerNeedsVo1);
//        map.put("customerVo",customerVo1);
        return ResultData.ok();
    }
    /**
     * 删除客户信息
     * @return
     */
    @RequestMapping(value = "/deleteCustomer" , method = RequestMethod.POST)
    @ApiOperation(value = "删除客户信息",notes = "删除客户信息",produces="冯弋舟", response = ResultData.class)
    public ResultData DeleteCustomer(@Param("listCustomer") ArrayList<Integer> listCustomer){
//        Map<String,Object> map=new HashMap<>();
//        List<CustomerVo> list1=new ArrayList<>();
//        CustomerVo customerVo1=new CustomerVo(1,"罗遗言文化有限公司",0,1,0,"杰克",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),"13121321","1561651");
//        List<CustomerNeedsVo> list2=new ArrayList<>();
//        CustomerNeedsVo customerNeedsVo1=new CustomerNeedsVo(50.0,145.0,1.5,1.9,"租房办公",1,"A1栋",802);
//        map.put("customerNeedsVo",customerNeedsVo1);
//        map.put("customerVo",customerVo1);

        return ResultData.ok();
    }

}

